/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package chameleon.view.command;

import chameleon.model.NuGatManager.NuGatManager;
import chameleon.view.input.Input;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author simon
 */
public class ExtractSubsetCommand extends Command {
    
    private String maskFileName_;
    
    public ExtractSubsetCommand(Input input, boolean help, String maskFileName){
        super(input,false,help);
        maskFileName_ = maskFileName;
    }

    @Override
    public Input execute() {
        if (!help_){
            InternalCheckCommand check = new InternalCheckCommand(input_, 3);
            if (check.isOk()){
                NuGatManager manager = (NuGatManager) input_.getManager();
                try {
                    manager.extractSubset(maskFileName_);
                } catch (IOException ex) {
                    Logger.getLogger(ExtractSubsetCommand.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
        else{
            outputManager_.displayString("quantify_out [-h | -maskFilePath]\n"
                    + "This command quantify out all the variables present in the file\n");
        }
        return input_;
    }
    
}
